<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('process_steps', function (Blueprint $table) {
            $table->id();
            $table->string('step_id')->default('')->comment('步骤ID，自增主键');
            $table->string('flow_id')->default('')->comment('关联流程id');
            $table->string('step_name')->default('')->comment('步骤名称');
            $table->string('step_order')->default('')->comment('步骤顺序(从1开始)');
            $table->string('description')->nullable()->comment('步骤详细说明');
            $table->string('required_time')->default('')->comment('预计时间');
            $table->string('required_equipment')->default('')->comment('所需设备');
            $table->string('required_material')->default('')->comment('所需物料');
            $table->string('prev_step_id')->nullable()->comment('上一步');
            $table->string('next_step_id')->nullable()->comment('下一步');
            $table->tinyInteger('status')->default(0)->comment('1启用0未启用');
            $table->text('quality_standard')->default('')->comment('质量标准');
            $table->string('start')->nullable()->comment('开始时间');
            $table->string('end')->nullable()->comment('结束时间');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('process_steps');
    }
};
